<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
# ${item.getLogicName()}(${item.getName()})

  ${item.getMemo()}

## 关系
<#if srfemptylist(item.getMajorPSDERs()) && srfemptylist(item.getMinorPSDERs())>
无
<#else>
{% plantuml %}
</#if>
<#if item.getMajorPSDERs()??>
<#list item.getMajorPSDERs() as der>
<#if der.getDERType() == 'DER1N'>
${der.getMajorPSDataEntity().getLogicName()} *-- ${der.getMinorPSDataEntity().getLogicName()} 
<#elseif der.getDERType() == 'DERINDEX'>
${der.getMajorPSDataEntity().getLogicName()} <|-- ${der.getMinorPSDataEntity().getLogicName()} 
<#elseif der.getDERType() == 'DERINHERIT'>
${der.getMajorPSDataEntity().getLogicName()} <|--  ${der.getMinorPSDataEntity().getLogicName()} 
</#if>
</#list>
</#if>
<#if item.getMinorPSDERs()??>
<#list item.getMinorPSDERs() as der>
<#if der.getDERType() == 'DER1N'>
${der.getMajorPSDataEntity().getLogicName()} *-- ${der.getMinorPSDataEntity().getLogicName()} 
<#elseif der.getDERType() == 'DERINDEX'>
${der.getMajorPSDataEntity().getLogicName()} <|-- ${der.getMinorPSDataEntity().getLogicName()} 
<#elseif der.getDERType() == 'DERINHERIT'>
${der.getMajorPSDataEntity().getLogicName()} <|--  ${der.getMinorPSDataEntity().getLogicName()} 
</#if>
</#list>
</#if>
<#if srfemptylist(item.getMajorPSDERs()) && srfemptylist(item.getMinorPSDERs())>
<#else>
hide members
{% endplantuml %}
</#if>

## 属性

| 属性名称        |    中文名称    | 类型     |  备注  |
| --------   |------------| -----   |  -------- | 
<#if item.getAllPSDEFields()??>
<#list item.getAllPSDEFields() as field>
|${field.getLogicName()}|${field.getName()}|${field.getDataType()}|&nbsp;${field.getMemo()}|
</#list>
</#if>

## 值规则
| 属性名称    | 规则    |  说明  |
| --------   |------------| ----- | 
<#if item.getAllPSDEFValueRules()??>
<#list item.getAllPSDEFValueRules() as defvaluerule>
|${defvaluerule.getPSDEField().getLogicName()}|${defvaluerule.getName()}|${defvaluerule.getRuleInfo()}|
</#list>
</#if>

## 状态控制

<#if srfemptylist(item.getAllPSDEMainStates())>
无
<#else>
<#if item.getDEMainStateDEFields()??>
<#list item.getDEMainStateDEFields() as field>|${field.getLogicName()}|</#list>行为控制模式| 控制行为 | 操作标识控制模式 | 控制操作 |
</#if> 
<#if item.getDEMainStateDEFields()??>
<#list item.getDEMainStateDEFields() as field>| --------   |</#list> ------------|------------|------------|------------|
</#if>
<#if item.getAllPSDEMainStates()??>
<#list item.getAllPSDEMainStates() as mainstate>
<#if item.getDEMainStateDEFields()??>
<#list item.getDEMainStateDEFields() as field>
<#if field_index == 0>|Value|<#elseif field_index == 1>|Value2|<#elseif field_index == 2>|Value3|</#if></#list></#if> <#if mainstate.isActionAllowMode()>允许<#else>不允许</#if>| <#if mainstate.getPSDEMainStateActions()??><#list mainstate.getPSDEMainStateActions() as stateaction>${stateaction.getPSDEAction().getLogicName()}<br></#list></#if> | <#if mainstate.isOPPrivAllowMode()>允许<#else>不允许</#if> | <#if mainstate.getPSDEMainStateOPPrivs()??><#list mainstate.getPSDEMainStateOPPrivs() as stateoppri>${stateoppri.getPSDEOPPriv().getName()}<br></#list></#if> |
</#list>
</#if>
</#if>

<#if item.getDEMainStateDEFields()??>
<#list item.getDEMainStateDEFields() as field>
${field.getLogicName()}

<#if field.getPSCodeList()??>
| 状态        |    状态值   |
| --------   |------------|
<#if field.getPSCodeList().getAllPSCodeItems()??>
<#list field.getPSCodeList().getAllPSCodeItems() as codeitem>
|${codeitem.getName()}|${codeitem.getValue()}|
</#list>
</#if>
</#if>
</#list>
</#if>

## 行为
| 行为    | 类型    |  说明  |
| --------   |------------| ----- | 
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
|${deaction.getLogicName()}|${srfcodelist2("DEActionType2",deaction.getActionType())}|&nbsp;${deaction.getMemo()}|
</#list>
</#if>

## 处理逻辑
<#if item.getAllPSDELogics()??>
<#if srfemptylist(item.getAllPSDELogics())>
无
<#else>
<#list item.getAllPSDELogics() as logic>
* ${logic.getLogicName()} (${logic.getCodeName()})
  
   ${logic.getMemo()}

{% plantuml %}
hide footbox

<#list logic.getPSDELogicLinks() as link>
<#assign src=link.getSrcPSDELogicNode()>
<#assign dst=link.getDstPSDELogicNode()>
<#if (src.getLogicNodeType()=='BEGIN' || src.getLogicNodeType()=='RAWSQLCALL' || src.getLogicNodeType()=='PREPAREPARAM')>${item.getLogicName()}<#elseif (src.getLogicNodeType()=='STARTWF')>${src.getPSDEWF().getPSDataEntity().getLogicName()}<#elseif (src.getLogicNodeType()=='DEACTION')>${src.getDstPSDataEntity().getLogicName()}</#if> -> <#if (dst.getLogicNodeType()=='BEGIN' || dst.getLogicNodeType()=='RAWSQLCALL' || dst.getLogicNodeType()=='PREPAREPARAM')>${item.getLogicName()}<#elseif (dst.getLogicNodeType()=='STARTWF')>${dst.getPSDEWF().getPSDataEntity().getLogicName()}<#elseif (dst.getLogicNodeType()=='DEACTION')>${dst.getDstPSDataEntity().getLogicName()}</#if>: ${dst.getName()}
</#list>
{% endplantuml %}

| 步骤       | 操作        |
| --------   | --------   |
<#list logic.getPSDELogicLinks() as link>
<#assign src=link.getSrcPSDELogicNode()>
<#assign dst=link.getDstPSDELogicNode()>
<#if src.getLogicNodeType()=='BEGIN' >
|${link_index}|${src.getName()} | 
</#if>
|${link_index+1}|${dst.getName()} |
</#list>
<center>${logic.getLogicName()}</center>
</#list>
</#if>
</#if>

## 查询集合

* **查询**

| 查询编号 | 查询名称       | 默认查询 |   备注|
| --------  | --------   | --------   | ----- |
<#if item.getAllPSDEDataQueries()??>
<#list item.getAllPSDEDataQueries() as query>
|${query.getName()}|${query.getLogicName()}<#if query.getAllPSDEDataQueryCodes()??><#if !srfemptylist(query.getAllPSDEDataQueryCodes())>(<#list query.getAllPSDEDataQueryCodes() as dequerycode><#if dequerycode_index gt 0>、</#if>[${dequerycode.getDBType()}](../../appendix/query_${dequerycode.getDBType()}.md<#noparse>#</#noparse>${item.getCodeName()}_${query.getCodeName()})</#list>)</#if></#if>|<#if query.isDefaultMode()>是<#else>否</#if>|&nbsp;${query.getMemo()}|
</#list>
</#if>

* **数据集合**

| 集合编号 | 集合名称   |  包含查询  | 默认集合 |   备注|
| --------  | --------   | -------- | --------   | ----- |
<#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dataset>
|${dataset.getName()}|${dataset.getLogicName()}|<#if dataset.getPSDEDataQueries()??><#if !srfemptylist(dataset.getPSDEDataQueries())><#list dataset.getPSDEDataQueries() as dequery><#if dequery_index gt 0>、</#if>${dequery.getName()}</#list></#if></#if>|<#if dataset.isDefaultMode()>是<#else>否</#if>|&nbsp;${dataset.getMemo()}|
</#list>
</#if>

## 查询模式
| 属性      |    搜索模式     |
| --------   |------------|
<#if item.getAllPSDEFields()??>
<#list item.getAllPSDEFields() as field>
<#if field.getAllPSDEFSearchModes()??>
<#list field.getAllPSDEFSearchModes() as defsearchmodel>
|${field.getLogicName()}(${field.getName()})|${defsearchmodel.getValueOP()}|
</#list>
</#if>
</#list>
</#if>

## 导入模式
<#if item.getAllPSDEDataImports()??>
<#if srfemptylist(item.getAllPSDEDataImports())>
无
<#else>
<#list item.getAllPSDEDataImports() as dataimport>
* ${dataimport.getName()}

<#if dataimport.getPSDEDataImportItems()??>|<#list dataimport.getPSDEDataImportItems() as importitem><#if importitem.getCaption()??>${importitem.getCaption()}<#else>${importitem.getName()}</#if>|</#list></#if>
<#if dataimport.getPSDEDataImportItems()??>|<#list dataimport.getPSDEDataImportItems() as importitem> :------: |</#list></#if>
<#if dataimport.getPSDEDataImportItems()??>|<#list dataimport.getPSDEDataImportItems() as importitem> - |</#list></#if>
</#list>
</#if>
</#if>


## 导出模式
<#if item.getAllPSDEDataExports()??>
<#if srfemptylist(item.getAllPSDEDataExports())>
无
<#else>
<#list item.getAllPSDEDataExports() as dataexport>
* ${dataexport.getName()}

<#if dataexport.getPSDEDataExportItems()??>|<#list dataexport.getPSDEDataExportItems() as exportitem><#if exportitem.getCaption()??>${exportitem.getCaption()}<#else>${exportitem.getName()}</#if>|</#list></#if>
<#if dataexport.getPSDEDataExportItems()??>|<#list dataexport.getPSDEDataExportItems() as exportitem> :------: |</#list></#if>
<#if dataexport.getPSDEDataExportItems()??>|<#list dataexport.getPSDEDataExportItems() as exportitem> - |</#list></#if>
</#list>
</#if>
</#if>